package com.wandar.gc.core;

import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import com.wandar.gc.config.Config;


public class DBConnection {

	/**
	 * 获取连接库
	 * 
	 * @return
	 * @throws IOException 
	 * @throws InstantiationException
	 * @throws IllegalAccessException
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 */
	public static Connection getConnection() throws IOException, SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{
		
		Class.forName(Config.driverClass).newInstance();
		Connection connection = DriverManager.getConnection(Config.connectionURL,Config.username, Config.password);
		return connection;
	}

}
